package com.aaa.stock.controller.api;


import com.aaa.entity.InventoryLog;
import com.aaa.entity.Medicines;
import com.aaa.stock.service.InventoryService;
import com.aaa.stock.vo.InventoryVo;
import com.aaa.stock.vo.Inventoryvo1;
import com.aaa.stock.vo.MedicinesVo;
import com.aaa.vo.Result;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("stock/api/inventory")
public class ApiInventoryController {

    @Autowired
    private InventoryService inventoryService;

    @PostMapping("getinventory/{currentPage}/{pageSize}")
    public Result<IPage<Medicines>> getinventory(
            @PathVariable Integer currentPage,
            @PathVariable Integer pageSize,
            @RequestBody InventoryVo inventoryVo
    ){
        return  inventoryService.findByall(currentPage,pageSize,inventoryVo);
    }

    @PostMapping("getinventory1/{currentPage}/{pageSize}")
    public Result<IPage<InventoryLog>> getinventory1(
            @PathVariable Integer currentPage,
            @PathVariable Integer pageSize,
            @RequestBody Inventoryvo1 inventoryVo1
    ){
        return  inventoryService.findByall1(currentPage,pageSize,inventoryVo1);
    }
}
